package com.atguigu.controller;

import com.atguigu.entities.CommonResult;
import com.atguigu.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("/consumer/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id") Long id){
        return orderService.getPaymentById(id);
    }

    //调用超时业务
    @GetMapping("/consumer/payment/timeout")
    public String timeout(){
        return orderService.timeout();
    }
}
